Ovation Pro Document | 2003-03-11 | 462KB | 3,670 lines
OvationPro
(23-March-02)
1 to 16
Generic
Black
White
Transparent
Green
Magenta
Yellow
Registration
RGB000000
RGBFFFFFF
Trinity.Medium.Italic
Trinity.Bold.Italic
Homerton.Bold
Homerton.Medium.Oblique
Homerton.Bold.Oblique
Homerton.Medium
Trinity.Medium
Trinity.Bold
Corpus.Medium
BodyText
Main Heading
Sub-Heading
Hanging indent
Centre
Corpus.Medium
Effect17
half-space
Sub-SubHeading
Effect22
Table
Justify
Homerton.Medium
NoIndent
NoGap
Effect1647
Effect1650
Effect837
Effect841
Effect844
+aA'%
Vfd%P
tM">\
{filename} P{pagenumber} {datetime}
Derek Haslam
Tutorials for Powerbase
Powerbase
is an extremely powerful program with a great many features, but that doesn
t mean it is difficult to use. The procedures to search for, add, delete, edit and print records can be learned very quickly but, as with any new piece of software, the first steps often take the longest. This booklet uses some ready made example databases supplied on the distribution disc to help familiarise you with the main functions of the program.
It consists of two sections. The first is a Quick Tutorial aimed at inexperienced users who may not have used a database program before. The Main Tutorial is meant for people who, although new to
Powerbase
, have some familiarity with other datab
ase programs. If you fall into this category you could skip the Quick Tutorial and move straight on to the Main Tutorial.
Quick Tutorial
This tutorial is intended to acquaint the new user as painlessly as possible with the most commonly-used facilities of
Powerbase
. It does not explain how to create a database from scratch (for this, see
of the main manual. There is also a simple example in the Main Tutorial.), nor does it delve into the many advanced features, but it does explain how to:
Start up
Powerbase
and open an existing database.
Browse through the database and search for individual records.
Add new records and alter or delete existing ones.
Query the database to create simple reports.
Close the database.
The supplied sample database
Friends
is used to illustrate most of these activities and you should copy it, and
Powerbase
itself, onto your hard disc before proceeding further.
Powerbase
can provide context-sensitive help on its windows and menus via Acorn
s interactive
application and you are advised to load this, resizing the help window and placing it at a convenient place on the screen. Further help can be had by choosing the
Help
entry which will be found on
Powerbase
s main menu and also on the iconbar menu. The ultimate source of help is, of course, the main printed manual or the set of text files in the
archive.
1 Starting
Powerbase
Double-click on the
Powerbase
icon. After a few seconds it will appear on the iconbar with the words
No data
beneath it to show that no database is open. Dragging the
Friends
icon to the
Powerbase
icon on the iconbar will open
Friends
for use and the words
No data
will be replaced by the name of the database.
When the database opens the record window appears with the
rst record in the database (the one for Badgery, Peter) displayed. If you are using a recent version of
Powerbase
you will
nd a
tool-pane
attached to the left-hand edge of the record window (Fig.1, below). This enables you to control the browsing, searching and editing functions of
Powerbase
2 Browsing and Searching
Now that you have a database running we will find out how to move from record to record and how to access any specific record by using a small group of letters called the
of the record. All the mouse clicks referred to (other than those for displaying menus) are made with the SELECT (left) button. If the chosen tool-pane action has an obvious opposite then you will find that using the ADJUST (right) mouse button brings about that effect. For example, while SELECT on the
single step
button takes you one record forward in the file, ADJUST on the same button takes you one record back.
2.1 Browsing through the Records
The buttons at the top of the tool-pane allow you to browse through the file. If you have
running, as previously suggested, it will tell you what each button does. Once you get the general idea you will find the symbols on the buttons logical and self-explanatory. The most often used ones act as follows:
button take you to the last record in the file when clicked with SELECT and to the first record when clicked with ADJUST. You are looking at the first record now, so click with SELECT and you will see the record for Turnip, Charles. ADJUST takes you back to Badgery, Peter again.
Movement through the file one record at a time is achieved using the
single step
button Try it out, again using SELECT and ADJUST, noting the way records come up in alphabetical, or reverse alphabetical, order.
fast-forward/ rewind
button lets you make longer jumps through a file. The number of records skipped is shown in the writable icon called
fast-forward interval
and has a default value of 10. As there are only 10 records in
Friends
these keys will have the same effect as the
ends
key, unless you make the interval smaller. Click in the writable icon, delete the 10 and enter 5 or 2, then try
fast-forward
again.
2.2 Searching for a record
Now try clicking the
search for record
button with SELECT. A small window opens to the right of the tool-pane (see Fig.2). This is the Search window and contains a writable icon in which to enter the key of the record you wish to display. In this database keys are made up from the first 4 letters of the surname plus the initial so, if you wanted to call up the record for Bloggs Fred you would enter BLOGF. Do so, then click on
Find (
or type the Return key on the keyboard) and the record will be displayed. Note that the key is shown in the heading of the record window.
If you enter a non-existent key
Powerbase
displays the record which most nearly matches the key, but flashes the key field to warn you that what is being displayed is not what you asked for.
3 Editing the Database
3.1 Modifying records
Point at any field and click SELECT. The red text caret will appear in the field. The contents of the field may now be edited with the aid of the keystrokes which are standard for all RISC OS writable icons. i.e.
Ctrl U
clears the field.
Delete
removes the character to the left of the caret.
Copy (or End)
removes the character to the right of the caret.
Shift Copy/End
deletes the word to the right of the caret.
Ctrl Copy/End
deletes everything from the caret to the end of the line.
and =>
move the caret left/right by one character.
Shift <=
and Shift=>
move the caret left/right by one word.
Ctrl <=
and Ctrl =>
move the caret to start and end of the field.
Having modified one or more fields you may be wondering what you have to do to make
Powerbase
save the modified record so that the changes won
t be lost. You don
t need to do anything!
Powerbase
will ensure that your changes are saved when you display a different record or close the database.
3.2 Recovering data after a mistake
You may edit the wrong field by mistake and want to restore the previous contents. Call up Bloggs Fred
s record and change the address from
12 Woodland Road Exeter
12 Woodville Road Exmouth
. Now click MENU over the first line of the address. The second entry on the main menu (
Field
) contains a short group of characters called the
of the field, in this case ADD1. Slide off the menu to the right, which opens the
Field
sub-menu, and choose the next to last entry;
Undo changes
. The contents of the field will revert to
12 Woodland Road
. Notice that
the first line of the address is affected; the town is still
Exmouth
. If you want to restore that field as well click MENU over it and follow the procedure just described.
There might be occasions when you make a hopeless mess of a record and want to discard
the changes and revert to what you started with. You could, of course,
each field separately as we just did for the street address and town but there
s a quicker way. Look near the bottom of the
main
menu, (just above
) and you will see that here too is an
Undo changes
option. Choosing this undoes all the alterations you have made.
It is important to realise that these facilities depend on the fact that
Powerbase
holds the currently-displayed record in memory and will therefore only work if the altered record has remained on display from the time you started changing it up to the point where you decided to
. If you have looked at another record or clicked on
Update
in the meantime then the changes will have been written to the disc and thus become
permanent
3.3 Adding and deleting records
To add a new record we use the
add record
button. Clicking on this offers a blank record into which you can type new data. You need not complete all the fields, in fact the only field into which you
must
type something is the NAME field. This is the
key field
; the one from which the key, mentioned earlier, is derived. If you leave this field blank then nothing is written to the database.
Type the name
Bodmin George
, then go to the beginning of the file and step through it record by record. You will find that your new record has been inserted in the correct place, i.e. the sequence goes: Badgery, Bloggs, Bodmin, Cavendish.
Now try deleting the record you
ve just added. If you refer to Fig.1 you will see a
dustbin
button
labelled
delete
which will do exactly that, but don
t use it just yet. Make sure that the unwanted record is on the screen and click the button above instead. You will now find that Bodmin
s record has vanished; the names run straight from Bloggs to Cavendish, just as they did before you added Bodmin.
This looks a bit
easy. Suppose you clicked the button by mistake and deleted an important record? No problem; what you have just done has been made easy because the action is far less drastic than it looks. The record hasn
t really been deleted at all. Click the
change subfile
button and
Bodmin
will reappear. You will soon find, however, that it appears to be the
only
record in the file! Don
t worry; nothing has been lost. A
Powerbase
database is treated as six separate
subfiles
numbered 0
5. When you first open the database you are looking at Subfile 0 and the heading of the record window shows this. If you look at the heading now you will see that it has changed to Subfile 1.
The button above
delete
does
delete records; it merely
moves
records from one subfile to another, as its label implies. A click with SELECT moves the displayed record to the next subfile in sequence. Thus, in the above case the
Bodmin
record has been moved from subfile 0 to subfile 1. A record in subfile 1 would be moved to subfile 2 and so on. When it gets to 5 the next click moves it into subfile 0 where it was originally. As you may have guessed, using ADJUST instead of SELECT moves records in the opposite direction, i.e. from subfile 1 to 0 or from subfile 0 to 5.
If you
want to lose a record for good you consign it to the dustbin by clicking on
delete
. As this button
s action is more drastic than that of the other you are given a chance to change your mind. A window headed
Powerbase: please confirm:
will appear displaying the question
Delete record permanently?
Clicking
causes the record to be deleted,
Cancel
removes the warning window from the screen leaving the record untouched.
4 Printing Lists
Before
Power
can produce a list it must be told:
which
fields
should appear on the list
which
records
should appear on the list
4.1 Making the field selection
Specifying the fields you want is easy. To include a field point at it and click with ADJUST. The selected field will then appear with its foreground and background colours reversed. If you change your mind you can de-select it by clicking on it again with ADJUST. The order in which you select the fields is the order in which they will appear in the printed list. Take care with this as there is nothing on the screen to indicate what order the fields will be in (but see section
below). Field selections may be saved (using
Save selection
from the
Print
submenu) and reloaded for future use. For now select the name and the first 3 fields of the address.
4.2 Choosing which records to print
Specifying which records to print is somewhat more complicated. Click the
Print
button on the tool-pane
(or type the Print key on the keyboard). A window called the Match window (Fig. 3) will open.
Unless you have selected at least one field, as described in
the menu button will be shaded as illustrated. Otherwise, clicking on it will display a list of the selected fields
in order of selection
The caret will be in the writable icon. This is where you specify the criteria which records must meet for inclusion in the list. If you just click on the
Print
button (or type Return) without entering anything, you will obtain a list of the whole database (or, more accurately, of the the whole of the current subfile). Try that first.
When the process is complete the list will be displayed in a window. If no records at all are printed make sure the icon for subfile 0 is highlighted as shown. Click on it with SELECT if it isn
t. If you point to a record in the list and double-click with SELECT
Powerbase
will display the chosen record in the main record window. Note that the caret is placed in the field you were pointing to on the list. This is very useful if you spot errors in the data whilst examining a list. A double click on the offending item offers the record with the caret correctly positioned for editing.
Most queries involve printing only some of the records, not the whole database. To target a particular group of records we need to enter a
search formula
which will distinguish the records we want to print from all the rest of the records. Search formulae can be quite complex and a more detailed treatment is given in the Manual. Only a few simple examples are shown here. Enter the following before clicking on
Print
ADD2=Exeter
The report window appears showing just one record: the one for
Bloggs Fred
. ADD2 is called the
of the field. The label which appears beside a field on the screen is called its
descriptor
and you might have expected such labels to be used to refer to fields in search formulae. This is not done for two reasons:
Descriptors can be inconveniently long for use in this way.
Fields don
t necessarily
have
descriptors. Of the 5 address fields only the first and last have descriptors (Address and Postcode respectively). Since every data field needs a
handle
of some sort so that we can include it in a search formula we give each a tag, which is never more than 4 characters. Clicking MENU over a field makes its tag appear in the second menu item.
The record for
Bloggs Fred
is, however, not the only one with an address in Exeter. There is another (
Sunningdale Samantha
) but with Exeter in ADD3 rather than ADD2. You can print both on the same list by using the formula:
ADD2,ADD3=Exeter
Notice the way the alternative tags are separated by commas. We call this a
tag list
. A record will be printed if any one of the tags in the tag list is matched. The part of the search formula after the = sign is called the
target
and here too we may specify several in a
target list
. Try the following:
ADD3=Exeter,Anytown
and also:
ADD2,ADD3=Exeter,Anytown
The first of these examples prints the records for
Soap Joe
and
Sunningdale Samantha
, the second prints these two and
Bloggs Fred
as well. What the second formula is saying is
Print all the records which have either
Exeter
Anytown
in either the ADD2 or ADD3 field
The characters we want to match don
t, of course, always make up the
entire
field. You can also search for part of a field. Suppose you wanted the records for people called Peter, Fred and Jean. Enter the formula:
NAME{Peter,Fred,Jean
and you will find that the records for
Badgery Peter
Bloggs Fred
and
Ford Jean
are printed. The curly bracket (
) means
contains
. i.e. the name field doesn
t have to consist
wholly
of Peter, or Fred or Jean, but has to contain one of these names somewhere within it.
4.3 Hard copy
So far you have displayed reports in a window. If you want to send them to your printer run
Printers
, switch on the printer, then click MENU over the displayed report. The
Save as text
option leads to a standard
Save
box from which you can drag the file icon to
Printers
on the iconbar. You could also drag it to a directory window to save it. Or you could simply type Return, in which case the report would be saved under a suitable default name in a directory called
PrintJobs
inside the
Friends
database directory. Every
Powerbase
database has a
PrintJobs
directory to use as a general dumping ground for reports and which needs to be cleared out periodically. Choose
Show jobs done
from the
Print
submenu to display it.
If your printer is one of the more recent inkjets you might not be able to print plain text files by simply dragging them to the
Printers
icon as described above, because some such printers contain no fonts of their own. Clicking the icon
in Fig.3 will open
Powerbase
Print Options
window, at the top of which is an area marked
Destination
. Select the
Printer
button instead of the
Window
button and click on
Accept
. You should now be able to send output directly to the printer provided it is ready for use and
Printers
is running.
5 Backing up
You are strongly advised to back up your database whenever you make changes to it and this is made easy by the provision of a
Backup
button on the tool-pane. However,
Powerbase
needs to be told where to back up. Clicking ADJUST on the button opens a window on which you are invited to drop a directory whose pathname will then appear in the writable icon. This is your backup directory. If you want to use it for backing up
databases then select the
in Powerbase
radio button and click
Save choices
. If it is the backup directory for the current database only, select
in database
before clicking
Save choices
Once a backup directory has been speci
ed the stored pathname will be loaded when the database is opened and a click with SELECT on the
Backup
button will make a copy of your database. If you want automatic backups you should select the
Save on closing
button before saving the pathname.
Open directory
is also useful for inspecting the contents of the backup directory or retrieving the backup copy if necesssary.
If there is no de
ned backup directory a SELECT click on the
Backup
button is ignored.
6 Closing down
A database may be closed down by choosing
Close database
from the iconbar menu. When you do so all relevant data stored in memory is saved to disc and the database is closed. You do not have to do anything to save the database file itself to disc since it has been there all along. Only the current record is in memory at any one time and this is automatically written back to disc when it has been changed in any way.
If you are going to use another database straight away just double click on it or drag it to the
Powerbase
icon on the iconbar. In fact you don
t even need to close the previous database before doing this;
Powerbase
will do it for you
To terminate
Powerbase
itself use the
Quit
option on the iconbar menu.
Main Tuto
This tutorial is intended to acquaint a new
user with the most commonly-used facilities of
Powerbase
. It explains how to:
Start up
Powerbase
and open an existing database.
Browse through the database and search for individual records.
Add new records and alter or delete existing ones.
Query the database to create simple reports.
Perform a simple data-merge with
Impression
Ovation Pro.
Close the database.
Create a simple database.
Add new fields to an existing database.
Alter the primary key structure.
The sample database
Elements
is used to illustrate these activities.
Powerbase
can provide context-sensitive help via Acorn
s interactive
application and you are advised to load this, resizing the help window and placing it at the top right of the screen. Further help can be had by choosing the
Help
entry on
Powerbase
s main menu or on the iconbar menu.
1 Starting
Powerbase
Double-click on the
Powerbase
icon. After a few seconds it will appear on the iconbar with the words
No data
beneath it to show that no database is open. Dragging the
Elements
icon onto the
Powerbase
icon on the iconbar will open
Elements
for use and the words
No data
will be replaced by the name of the database. Double-clicking on the
Elements
icon has the same effect, in fact if
Powerbase
t already on the iconbar a double-click on
Elements
will install it for you provided that the
Powerbase
icon has been seen by the
When the database opens the record window appears with the
rst record in the database (the one for Badgery, Peter) displayed. Attached to the left-hand side of the record window is the
tool-pane
(see Fig.1 on p.2) which enables you to control the browsing, searching and editing functions of
Powerbase
2 Browsing
and searching
Now that you have a database running we will find out how to move from record to record and how to access any particular record by using a small group of letters called the
of the record. Most of the tool-pane buttons respond to clicks with both SELECT and ADJUST, the two mouse buttons having opposite effects.
2.1 Browsing through the records
The button
s at the top of the tool-pane allows you to browse through the file. If you have
!Help
running, as previously suggested, it will tell you what each button does. Once you get the general idea you will find the symbols on the buttons logical and self-explanatory. The most commonly used ones act as follows:
ends
takes you to the end of the file (with SELECT) and the beginning (with ADJUST), i.e. to ZIRCONIUM and ACTINIUM respectively.
single step
moves through the file by one record at a time. From ACTINIUM, clicking SELECT takes you to ALUMINIUM, whence ADJUST takes you back to ACTINIUM.
fast-forward/rewind
goes through the file by longer jumps. SELECT takes you from ACTINIUM to BISMUTH and ADJUST back to ACTINIUM. The
fast forward/rewind interval
value is shown in a writable icon. It is initially set to 10 but can be altered by clicking in it with SELECT and entering a new value. Try entering 2 or 5 and fast-forwarding again.
At either end of the file
wrap around
occurs. If you are at the final record (ZIRCONIUM) one record forward takes you to ACTINIUM again. Similarly, one record back from ACTINIUM goes to ZIRCONIUM.
play
stop buttons
resemble the corresponding controls of a cassette player.
starts an automatic run-through of the records without the need to touch any other buttons. When you get to the place you want, click on
. If the records go past too quickly you can slow the process down by increasing the number in the writable icon (the
fast forward interval
2.2 Key fields, Keys and Indexes
When using the buttons described above you will have noticed that the records appear to be arranged alphabetically by the name of the element. The actual order in which records occur in the file is in fact nothing like alphabetical, but the order in which they are
accessed
is determined by an
index
which forces them to appear in alphabetical order. Every database must have at least one index, but you can have as many extra ones as you wish.
If you click on the
change key
button the record for HYDROGEN is displayed. Now experiment with the top group of buttons as before. You will find that the records no longer appear in alphabetical order of name but in order of Atomic number instead. What we have done is change to a different index. If a database has several indexes
change key
allows you to cycle through them in opposite directions with SELECT and ADJUST. Since
Elements
has only two indexes both mouse buttons have exactly the same effect. When you change to a different index the screen always displays the first record as determined by that index.
An index is built from
keys
which are derived from a particular
key field
. The two indexes used by
Elements
are based on the Name and Atomic number fields. The way in which the key stored in the index is derived from the key field differs in the two cases. For the Name index the first four letters of the name are used. Since no two elements have names beginning with the same four letters this gives a unique value for the key. (Two letters would not be enough because of names like CHLORINE and CHROMIUM.) The Atomic number index is based on the whole 3-digit maximum length and the ordering is numeric. When a record is displayed the key is shown in the window title.
The record screen shows which fields are key fields and which are not. The labels, or
descriptors
, of fields are normally black. Where the fields are key fields they are shown in dark blue instead and the field related to the current index has its descriptor in red. Note also that the background colour of the NAME field is pale yellow whereas the rest are white. This indicates that NAME is the
primary
key field. The primary key is more important than the others. The index based on it is the only one which every database
must
have and is the one selected when a database is first opened.
2.3 Searching for a record
search for record
button, when clicked with SELECT, opens a small window, the Search window, to the right of the tool-pane (see Fig.2). It contains a writable icon in which to enter the key of the record you wish to display. Suppose you want to see the record for the element NITROGEN. If the current index is the Name then enter NITR and either type the Return key on the keyboard or click on the
Find
button. The required record quickly appears. If you enter the key of a non-existent record
Powerbase
displays the record which most nearly matches the key, but flashes the key field to warn you that what is being displayed is not what you asked for. You don
t necessarily need to type the whole key; NIT would do in this case, but NI would be ambiguous (there are elements called NICKEL and NIOBIUM).
To find NITROGEN when the Atomic number index is active you would need to know that the atomic number of nitrogen is 7. Change key, enter this number and type Return or click on
Find.
The required record appears. Abbreviated keys are not allowed in this case for obvious reasons; if you want element 103 (LAWRENCIUM) it
s no good entering 10 (NEON)!
You might want to examine a group of related records, e.g. the six similar elements LITHIUM, SODIUM, POTASSIUM, RUBIDIUM, CAESIUM and FRANCIUM which are known as the Alkali Metals. You could, of course, look up each in turn by entering its key but there is a better way. Click on the
Filter
button. The button becomes ticked and the Filter window (Fig.4) opens on the right of the tool-pane. This button is what we call an
option button
and is used to turn a particular feature ON or OFF. The six elements referred to all occur in group 1 of the Periodic Table of the elements so type
into the writable icon. and click on
Filter (
in the Filter window, not on the tool-pane). The record for CAESIUM is displayed. If you now experiment with the
single step
button you will find that they behave as if the six Alkali Metals were the only elements in the database; all the rest have been
filtered out
so that you access only the ones you are interested in. To return to normal operation either click the
Cancel
button on the Filter window or turn off the option button on the tool-pane. If you want the Filter window out of the way without cancelling the filter click on
Close
. The option button on the tool-pane remains selected.
3 Editing the Database
3.1 Modifying records
Pointing the mouse at any field and clicking SELECT places the caret in that field. The contents of the field may then be edited in the standard way for RISC OS writable icons, with which you will be familiar. Changes made to a record cause the record to be written back to the database whenever you display a different record or close the database. There is a button on the tool-pane called
Update
but you don
t normally need to use it.
3.2 Using the clipboard
It is sometimes necessary to copy the contents of one field into another, either in the same record or a different record. This can be done with the aid of the
clipboard
which is controlled by buttons
copy to clipboard
and
paste from clipboard
. Place the caret in the field you want to copy and click on the first of these. Moving the caret to another field and clicking
paste from clipboard
writes the data from the clipboard into that field, over-writing its previous contents. You may continue to
paste
the data into new fields as often as you like. Only when you click
copy to clipboard
again are the contents of the clipboard changed. Data pasted into a field will not be allowed to overflow; if too long for the field it will be cut to the permitted length. As an added precaution you can
t paste into a field if there is nothing on the clipboard so accidental blanking of fields is avoided. If you use a wordprocessor, whether on a RISC OS machine or not, you will probably be familiar with the keystrokes
Ctrl-C
and
Ctrl-V
for Copy and Paste. You can use these in
Powerbase
too; they do exactly the same as the tool-pane buttons.
If you
re copying from one field to another in the same record there
s an even easier way. Just point the mouse at the field, click SELECT and keep it held down. You can now drag and drop the data to another field.
3.3 Undoing mistakes
You might edit the wrong field by mistake and want to restore the previous contents. Click MENU over the field. The second entry on the main menu contains the
of the field. Slide off the menu to the right to open the
Field
sub-menu and choose
Undo changes
. The previous contents of the field will be restored. Similarly, if you make a mess of a whole record and want to go back to the way it was you can choose
Undo changes
from the main menu. It is important to realise that the Undo facilities will not work if you have looked at another record before using them (or clicked on
Update
). You can only recover data which has been altered in or removed from the currently-displayed record.
3.4 Adding new records
First we will add a new record for a fictitious element as described below:
NAME
TASMANIUM
SYMBOL
Ts
ATOMIC NUMBER
Click SELECT on the
add record
button. A blank record will be displayed with the caret in the NAME field. Enter TASMANIUM here and type Return. The caret will jump to the SYMBOL field. Enter Ts. You will now need to press Return twice to get to ATOMIC NUMBER (One press takes you to the field after NAME where the origin of the element
s name is given. The field has no descriptor.) Alternatively you could point the mouse at the ATOMIC NUMBER field and click SELECT. There is no need to press Return after entering a field in order to accept the data; it
s just the most convenient way of getting to the next field. When entering data into widely-scattered fields it is more convenient to use the mouse to move the caret.
Having entered the data click any of the browsing buttons so that a different record is shown. Now use
search for record
to find TASMANIUM by name (its key will be TASM). Change to the Atomic number index and find it by atomic number (108). In both cases try moving to the record just before and just after the new one, noting that it has been placed in its correct position in both indexes: between TANTALUM and TECHNETIUM in the Name index and at the end of the Atomic number index.
3.5 Data Input Validation
When entering the above data you may have noticed that the Name field will only accept capital letters and the Atomic number field will only accept numerals. Any others are simply ignored. We call this feature
character validation
. Another level of data validation, which we will now illustrate, is called
table validation
Make an entry in the Group field. Type X, for example, then try to move to another field by either typing Return or clicking the mouse. You will find that you can
t do so; you get an error message instead. This is because the Group field is linked to a
validation table
which means that only entries which appear in the table may be used in that field. Fields linked to validation tables are distinguished by using dark green, instead of black, as the foreground colour.
To see what the validation table contains, place the caret in the Group field then click on the
Table
button. The validation table will be displayed in its own window. Only items in the left column of the table may be entered in the Group field. Element 108 would be a transition metal, so enter T. You will now find that
Powerbase
accepts your data.
Both character validation and table validation may be turned off and on by means of a button on the
Preferences
window. To get at this window click MENU over the
Powerbase
icon on the iconbar and choose
Preferences
from the iconbar menu. The rather large window which appears has a collection of option buttons down its left-hand side. The sixth of these (
Validate input
) is normally ON to indicate that validation is in effect. Click to turn it off then click on
Accept
. The
Preferences
window will be removed from the screen and you will find that input is no longer being validated.
3.6 Deleting records
Since
TASMANIUM
t a real element we want to remove it from our database. The
delete
button, (the one with the
dustbin
), will do exactly that but we won
t use it just yet. Make sure that the unwanted record is on the screen and click SELECT on the button above. You will now find that TASMANIUM has vanished; the names run from TANTALUM to TECHNETIUM and the atomic numbers end with 103, just as they did before you added the extra record.
What if you had clicked the button by mistake and deleted an important record?
Powerbase
handles this very nicely. The record hasn
t really been deleted at all. To prove this, click SELECT on the
change subfile
button. TASMANIUM will reappear. You will also find that it appears to be the
only
record in the file! Don
t worry; nothing has been lost. A
Powerbase
database is treated as six separate
subfiles
numbered 0-5. When you first open the database you are looking at Subfile 0 and the heading of the record window shows this. If you look at the heading now you will see that it has changed to Subfile 1. The button you have just clicked advances the subfile number by 1. When you reach subfile 5 the next click takes you to subfile 0. As you might expect, clicking with ADJUST has the opposite effect.
The button above
delete
does
delete records; it merely
moves
records from one subfile to another. Clicked with SELECT it moves the displayed record to the next subfile in sequence. Thus, in the above case TASMANIUM has been moved from subfile 0 to subfile 1. A record in subfile 1 would be moved to subfile 2 and so on. When it gets to 5 the next click moves it into subfile 0 where it was originally. As you may have guessed, ADJUST moves records in the opposite direction, i.e. from subfile 1 to 0 or from subfile 0 to 5.
If you
want to lose a record for good you consign it to the dustbin by clicking
delete
. As this button
s action is more drastic than that of the other two you are asked to confirm that this really is what you want to do before the deletion goes ahead.
4 Printing lists (reports)
Before
Powerbase
can produce a list, or
report
, as it is usually known in database-speak, it must be told:
which
fields
should appear on the list
which
records
should appear on the list.
4.1 Making the field selection
Specifying the fields you want is easy. To include a field point the mouse at it and click with ADJUST. The selected field will appear with its foreground and background colours reversed. If you change your mind about a field you can de-select it by clicking on it again with ADJUST. The order in which the fields will appear in the printed list is the order in which you select them. Take care since there is nothing on the screen to indicate in what order the fields were selected (although you can inspect the order once you have opened the Match window by clicking on the menu button in Fig. 3). The fields chosen for inclusion in a printout make up a
selection
which may be saved, using
Save selection
from the
Print
submenu, and reloaded for future use. Just for now select Name, Symbol and Group.
4.2 Choosing which records to print
Specifying which records to print is more complicated. Click the
Print
button on the tool-pane (or type the Print key on the keyboard)
. A small window appears (see Fig.3) in which you specify the criteria which must be met by records for inclusion in the list. If you just click the
Print
button (or type Return) without entering anything here you will obtain a list of the whole database (or, more accurately, the the whole of the current subfile). Try that first.
Nothing will be printed until the process is complete. The list will then be displayed in a window. If no records at all are printed make sure the icon for subfile 0 is highlighted as shown in Fig. 3. If the mouse pointer is over the main window the hourglass will tell you how far things have progressed. Pressing Escape will cause the process to be aborted. Assuming you now have a list in a window, clicking MENU over it displays a menu which leads to a Save box. You may save the list as a text file by dragging the file icon to a filer window or print it by loading
Printers
and dropping the file icon on the
Printers
icon on the iconbar *. If you point to a record in the displayed list and double-click with SELECT
Powerbase
will display the chosen record in the main record window. Moreover the caret is placed in the field you were pointing to on the list. This is very useful if you spot errors in the data whilst examining a list. A double click on the offending item offers the record with the caret correctly positioned for editing.
Most database queries don
t, of course, involve printing all the records. You will usually need to enter a
search formula
before clicking
Print
. You have already used a simple search formula when you typed
to filter out all but the six Alkali Metal records (see
). Search formulae can be complex and a more detailed treatment is given in
of the main manual. Only a few simple examples are shown here.
Suppose we want a list of all transitional elements. i.e. all those which have T in the
Group
field. We can do this by entering the search formula:
Group=T
seems the more obvious choice but
Elements
contains many fields which have no descriptor, such as the one on the first line which gives the origin of the element
s name. Every field which can hold data has to have a handle by which we can refer to it and that handle is called the field
. Tags are very short; never more than four characters. You have seen some tags already. Look at the list you printed earlier. The three columns are headed with the
tags
(NAME, SYM and GP) not the
descriptors
(Name, Symbol and Group). We therefore meet tags in two contexts:
specifying fields in search formulae
as the default column hea
dings in lists
The Print options window, displayed by choosing
Options
from the
Print
submenu, lets you change the column headings to field descriptors if you prefer them, but it is always the tags which are used in search formulae.
Type
in the space provided and click
Print
. This time the list will be a much shorter one and you will see that the GP column contains T in every case.
The second example involves printing all elements whose names end in
. What we need to specify is that the Name contains IUM and we do this by entering the search formula:
NAME{IUM
Note the use of a left brace (curly bracket) to mean
contains
. Another way to perform this search is to use a
wild-card
. Type:
NAME=$IUM
Clicking
Print
will produce the same list as before. The
is a wild-card character which can represent any number of unspecified characters. The search formula is saying in effect,
I don
t care what the first part of the name is as long as it ends with IUM
We will combine the previous two examples into a two-pronged search for all the TRANSITIONAL elements whose names end in
. The search formula this time is either:
NAME{IUM AND GP=T
or:
NAME=$IUM AND GP=T
Note the spaces before and after
. These are essential. You might like to try an alternative way of entering a search formula. It is designed for new users of a database or for occasional users who might forget what the tags of the fields are. Proceed as follows:
Click the
Help
button on Print window. This opens the Help window.
NAME should already be visible as the required field, but you need to select the radio button for
contains
Click in the space next to
Value
and enter
.
Click
Add to formula
. The search formula now reads
NAME{IUM
.
Click the
button.
Click on the
button to the right of the tag display and choose item 6 (GP)
Select the radio button for
is equal to
Enter
in the
Value
field.
Click
Add to formula
The complete search formula should now be visible so click
Print
and the list will be produced. The procedure takes far longer to describe than to do and can be a great help to the infrequent
Powerbase
user who has trouble remembering the syntax of search formulae. If you use complex queries often you may find it convenient to save them for future use.
Save query
from the
Print
submenu enables you to do this.
The biggest problem you are likely to encounter is not knowing the tags for the various fields. By using the above method you can see all the tags displayed in a menu or cycle through them using a pair of arrowheads (
icons). It is also useful to know that clicking with SELECT on a field while holding down Ctrl causes the tag of that field to appear in the search formula icon.
5 Merging data into an
Impression
Ovation Pro
document
The distribution disc contains a simple
Impression
document called
MergeTest
and an
Ovation Pro
document called
OproMerge
. Either may be used in conjunction with the
Elements
database to illustrate direct data-merging, which we will describe for
Impression
. The procedure with
Ovation Pro
is identical.
Ensure that
Impression
has been
by the filer. (You need not actually load it.)
Open the
Elements
database and drop
MergeTest
onto the record window. The Data merge window will appear.
Click on
Merge
. You will see that data relating to the record for ACTINIUM has been inserted into the
Impression
document.
The browse buttons on the tool-pane, may be used to move through the database merging different records into the document.
If a Filter has been specified it will restrict the merge operation to records matching the filter formula.
Print
may be used to print the document with the currently-merged data. To print a set of documents, one for each matching element, select
Print all
before clicking on
Merge
During data-merging
Impression
editing is disabled; you can
t place the caret in the document and the mouse pointer appears as a red and blue cross. Clicking on
Cancel
or closing the Data merge window restores normal editing.
The most widespread use for this powerful facility is
mail merging
where names, addresses and other information are merged into a standard letter to personalise it. For more information on data-merging, including instructions on how to prepare the
Impression
document, see
Ch.9
in the main manual.
6 Backing up
You are strongly advised to back up your database whenever you make changes to it and this is made easy by the provision of a
Backup
button on the tool-pane. However,
Powerbase
needs to be told where to back up. Clicking ADJUST on the button opens a window on which you are invited to drop a directory whose pathname will then appear in the writable icon. This is your backup directory. If you want to use it for backing up
databases then select the
in Powerbase
radio button and click
Save choices
. If it is the backup directory for the current database only, select
in database
before clicking
Save choices
Once a backup directory has been speci
ed the stored pathname will be loaded when the database is opened and a click with SELECT on the
Backup
button will make a copy of your database. If you want automatic backups you should select the
Save on closing
button before saving the pathname.
Open directory
is also useful for inspecting the contents of the backup directory or retrieving the backup copy if necesssary.
If there is no de
ned backup directory a SELECT click on the
Backup
button opens the window just like ADJUST does.
7 Closing down
A database may be closed down by choosing the
Close database
entry from the iconbar menu. When you do so, all the indexes stored in memory are saved to disc and the database is closed. You do not have to do anything to save the database itself to disc since it has been there all along. Only the current record is in memory at any one time and this is automatically written back to disc when it has been changed in any way.
Also saved automatically are validation tables and the link file which holds the links between the main database and the validation tables.
If you are going to use another database straight away just double click on it or drag it to the
Powerbase
icon on the iconbar. In fact you don
t even need to close the previous database before doing this;
Powerbase
will do it for you. To terminate
Powerbase
itself use the
Quit
option on the iconbar menu.
8 Creating a simple database
This section describes the creation of a simple address-book database. Make sure that the
Powerbase
icon is on the iconbar but with no database open. (
No data
under icon.) Click on the icon and a Save box appears showing a database icon and offering
!Database
as the default name. Change this to
Addresses
(the
will be added by
Powerbase
if you don
t include it yourself) and drag the icon to a suitable directory.
Powerbase
is now in
design mode
and the record window is covered with a blue grid to help in laying out the fields. Clicking MENU over this opens a menu different from the one you will have seen previously. Most of the entries will be shaded at this stage, but the one we want is
Create field
. When you choose this a the rather complex Field definition window (Fig. 5) opens.
Much of this can be ignored for the present
we did say a
simple
database
so leave the
Editable
radio button selected and the field-type as
Unrestricted
re going to call the first field
so type that into the
Descriptor
icon. Anything you enter there will appear on the record screen as a label for the field. Very important is the
which is used to identify a field uniquely. It is limited to 4 characters and we might as well use
. Upper-case is recommended for tags to distinguish them from descriptors. How long might a name be? 20 characters ought to be enough so enter
Data length
Click on
Create
and there
s the first field. Easy! But it
s not in the right place, is it? So point the mouse at it and drag with SELECT until it
s where you want it.
We now need several fields for the address: four ought to be enough. The first will obviously have the Descriptor
Address
but the layout looks neater if the other three are just aligned underneath without descriptors. This is quite permissible; descriptors are optional. Tags, however, are
optional and you can now see why: if a field had neither Descriptor nor Tag there would be no way of querying it by means of a search formula. Create four fields with tags ADD1, ADD2, ADD3 and ADD4. Make them all 20 characters long and drag them so that they line up neatly.
s enough for the present. Click MENU and choose
Default database
. You will be asked to confirm that
Powerbase
is to create 100 records with the first four letters of NAME as the primary key. That sounds acceptable (and can be changed later) so accept the suggestion
and there
s your database all ready for you to type data into! This illustrates just how easy
Powerbase
can be for a beginner, but there are loads of refinements for you to use when you are more used to the program. Go ahead and enter a few records before proceeding to the next stage.
9 Adding other fields
Oh dear! We left something out! There should be a field for the telephone number. It would be nice to have field for general notes too. Well, it can be done. Let
s start with the
Notes
field because, if we use the right type of field, we can add this very easily.
Click MENU on the iconbar icon and choose
Utilities=>Alter format
. Up comes the blue grid again with your record design displayed. When you choose
Create field
from the main menu you
ll find quite a lot of the window shown in Fig. 5 to be shaded because there are limits to what we can create by this method.
Select the
External
radio button. The field-type menu will now be showing
instead of
Unrestricted
. Enter
Notes
as the Descriptor and
as the Tag. What about the
Data length
s shaded to stop you entering anything! Never mind, you
ll soon see why. Click
Create
and what do you get? Not a white rectangle but a little square button with a small
icon on it! Move it to where you want it and then bring up the main menu. This time it
s the final choice,
Quit design
, which is needed.
When you get back to normal data-entry mode click on the little
Notes
button. Assuming RISC OS knows the whereabouts of a text editor (and it should at the very least be able to find
) a blank text window will open into which you can type anything you like and as much as you like. When you
ve finished, close the window in the usual way and the editor will prompt you to save the
le. Just accept whatever
lename is offered;
Powerbase
knows where the
le should go.
Try adding notes to several records and notice how the button changes to a text-file icon when you do so. On returning to these records, clicking the button with SELECT brings up the associated text for editing. The notes you enter are stored as a separate text file for each record, these text files being stored within the database application.
Ordinary
fields like the Name and Address fields are stored in a large text file called
Database
but the field you
ve just added occupies no space in
Database
at all. That
s why it
s called an External field, and it
s also why you can add it with so little effort.
The Telephone field is more of a problem because we
want this to be an
ordinary
field, and that involves rebuilding the whole of the
Database
file. It sounds pretty daunting, but it
s not really. Go to the iconbar menu and this time choose
Utilities=>Rebuild database
. The window shown in Fig. 6 appears.
The name offered for the reformatted database is
NewFormat
but let
s change that to
Addresses2
then drag the database icon into the directory where
Addresses
or to somewhere else if you prefer. In fact, if you simply want to call it
Addresses
you
drag it to a different directory because you
re about to build a
completely new
database, leaving your original
Addresses
database unaltered. This means that reformatting is a
safe procedure: there
s always the original database to fall back on if anything goes wrong. You can have hours of fun with this!
As soon as you drop the database icon in a directory the familiar design screen with the blue grid appears again, just as it did when you added the
Notes
field. A message tells you what to do and, as soon as you dismiss the message box, you can add the new field. This time, however,
Create field
gives you full access to the window shown in Fig. 5.
We want an
Editable
field and we might as well make it
Numeric
since it
s numbers we
ll be storing in it. (It doesn
t really matter: we aren
t going to attempt any
calculations
on phone numbers!) Click the menu button at the top-right corner and choose
Numeric
. Enter a suitable Descriptor, Tag and Data length. Click on
Create
then choose
Quit design
from the menu.
What happens now is that
Powerbase
creates an empty database with the new layout, copies all your data across from the old database, and finally leaves the new database open. A little window pops up to tell you that this is happening but your database is probably so small at this stage that it happens too fast to see.
Verify that you can now enter telephone numbers in the field you
ve just added and that everything you put into the original
Addresses
database has been copied across. You
ll also find that the original database is exactly as you left it.
10 Changing the primary key
When you created the address database by choosing
Default database
you left the choice of primary key to
Powerbase
. The result of doing this is always a key consisting of the first four characters of the first writable field, in this case the first four letters of the
field. This is a fairly primitive key-structure, even for such a simple database. Let
s assume you
re storing the names surname first. If many of the names in your database are of family members some of them are going to have the same key! A much better choice of key would make use of both surname
given name, so let
s change our primary key to do that.
Go to the
Utilities
submenu on the iconbar and choose
New primary key
. This displays the Key definition window which looks as in Fig.7, telling us that the structure of the key is the four
eftmost characters of the
first
word in the field whose tag is
. It is possible to change all four of these bits of information: the field, the word, the position in the word and the number of characters. You will see also that there is space for three other similar sets of information; in other words you could derive the key from up to four different fields or words.
Leave the first line as it is and click once on the down-pointing
icon on the second line. The
Field
icon should now read NAME like the first, the rest of the line reading 1, L and 20 (the maximum length of this field). Change the word to 2, leave the position as L (other choices are R, for
right
or a number indicating where the first character comes from). Change the length to 2 and click
Create
Powerbase
now asks:
Build index with records in same subfile of current database?
Tell it to proceed and the new primary key index will be created.
Looking at the keys as they appear in the title bar of the record window, you will see that they are now six, instead of four, letters long and that they consist of the first four letters of the surname plus the first two of the given name, thus distinguishing (most of the time) between people with the same surname, e.g.
, which contains the sample databases used in these tutorials,
MailMerge
PrintLabel
, which contains the documentation as a group of plain text files. We do not recommend that you try to use any of the supplied material directly from the zip files; decompress them onto your hard disc. A copy of
SparkPlug
is provided to enable you to do so. The procedure is as follows:
Make sure the filer has
the
SparkPlug
icon.
Double-click on the zip file.
SparkPlug
will be loaded and the file opened so that you can see its contents.
Drag the contents of the file into a suitable directory on your hard disc.
This process (which looks like ordinary file-copying) decompresses the files so that they can be used. Earlier versions of the distribution disc contained ArcFS files instead of zip files. Please note that ArcFS